<template>
	<not-login-page v-if="!userStore.userInfo"></not-login-page>
	<view v-else :class="nowTheme()">
		<common-top>
			<template #name>通讯录</template>
		</common-top>
		<view class="search">
			<view class="search-box">
				<view class="search-icon">
					<text class="iconfont icon-sousuo"></text>
				</view>	
				<input class="search-input" placeholder="查询我的好友"/>
			</view>
		</view>
		<view class="list">
			<view class="list-item" @click="goNewFriend()">
				<image class="add-friend-images" src="/static/images/newFriend.png"></image>
				<view class="item-title">新的朋友</view>
			</view>
			<view class="list-item">
				<image class="add-friend-images" src="/static/images/groupChat.png"></image>
				<view class="item-title">群聊</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import {useUserStore} from '@/stores/userStore.js'
import { onLoad } from '@dcloudio/uni-app'
import { nowTheme } from '@/utils/theme.js'
const userStore = useUserStore()

const goNewFriend=()=>{
	uni.navigateTo({
		url:'/pages/friends/newFriend'
	})
}

onLoad(()=>{
})
</script>

<style scoped lang="scss">
	.list{
		display: flex;
		flex-direction: column; /* 垂直排列子元素 */
		align-items: center; /* 水平居中子元素 */
		.list-item{
			width: 95vw;
			display: flex;
			flex-direction: row; 
			align-items: center;
			height: 100rpx;
			margin-top: 10rpx;
			border-bottom: 1px solid #ccc; /* 添加底部边框作为线条 */
			.add-friend-images{
				margin-left: 10rpx;
				height: 80rpx;
				width: 80rpx;
			}
			.item-title{
				font-weight: bold;
				margin-left: 20rpx;
			}	   
		}
	}


</style>
